[Fix](function) avoid false alarm of some datelike functions#59897
[Fix](function) avoid false alarm of some datelike functions#59897zclllyybb merged 2 commits intoapache:masterfrom
Conversation
|
run buildall |
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
TPC-H: Total hot run time: 31122 ms |
TPC-DS: Total hot run time: 173020 ms |
767f990 to
e82fbad
Compare
e82fbad to
2c5c451
Compare
|
run buildall |
TPC-H: Total hot run time: 31472 ms |
TPC-DS: Total hot run time: 174077 ms |
ClickBench: Total hot run time: 26.83 s |
|
run beut |
|
run buildall |
|
PR approved by anyone and no changes requested. |
TPC-H: Total hot run time: 31616 ms |
TPC-DS: Total hot run time: 173259 ms |
ClickBench: Total hot run time: 26.58 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
There was a problem hiding this comment.
Pull request overview
This PR fixes false alarm errors in date-related functions when processing NULL values from LEFT JOIN operations. When joins generate NULL rows with unspecified nested values, functions with use_default_implementation_of_null = true could raise spurious "out of range" errors. The fix changes these functions to handle nulls manually, avoiding validation on invalid default values.
Changes:
- Modified multiple date functions to set
use_default_implementation_for_nulls() = falseand handle NULL values manually - Added manual NULL map handling for
date_trunc,last_day,to_monday,unix_timestamp,from_seconds,from_milliseconds, andfrom_microseconds - Added regression test to verify NULL handling with LEFT JOIN operations
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| be/src/vec/functions/function_other_types_to_date.cpp | Removed error checking in date_trunc, modified unix_timestamp implementations to handle nulls manually, and updated last_day/to_monday to process NULL maps before validating data |
| be/src/vec/functions/function_date_or_datetime_computation.h | Updated from_second/from_millisecond/from_microsecond functions to manually handle NULL values |
| regression-test/suites/correctness_p0/test_date_trunc_error.groovy | Added test case with LEFT JOIN to verify date functions handle NULL values without errors |
| regression-test/data/correctness_p0/test_date_trunc_error.out | Expected output showing NULL values propagate correctly through date functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
PR approved by at least one committer and no changes requested. |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
join may generate null rows with unspecified nested value. may make some functions with `use_default_implementation_of_null = true` raise false positive alarm like `errCode = 2, detailMessage = (172.20.56.1)[E-218]Operation date_trunc of out of range`. this fix relates to some functions: ``` date_trunc last_day to_monday unix_timestamp from_seconds from_milliseconds from_microseconds ```
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
join may generate null rows with unspecified nested value. may make some functions with
use_default_implementation_of_null = trueraise false positive alarm likeerrCode = 2, detailMessage = (172.20.56.1)[E-218]Operation date_trunc of out of range.this fix relates to some functions:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)